<html>
  <head>
<script type="text/javascript" src="scripts/oodomimagerollover.js">
/***********************************************
* DOM Image Rollover II- By Adam Smith (http://www.codevendor.com)
* Script featured on and available at Dynamic Drive (http://www.dynamicdrive.com)
* Keep this notice intact for usage please
***********************************************/
</script>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-15269766-1");
pageTracker._trackPageview();
} catch(err) {}</script>
    <link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
  </head>
  <body>
    <div id="container">
    <div id="header">
        <div id="logoline">Upvote Engine</div>
        <div id="linksline">
            <div id="loginLink"><a href="{{ url }}">{{ url_linktext }}</a></div>
            <div id="userLink">{% if loggedin %}<a href="/user">User Info</a>{% endif %}</div>
            {% if votes %}<div id="yourvotes">Your Votes: {{ votes }}</div>{% endif %}
        </div>
    </div>
    {% for entry in entries %}
      {% if entry.entry.author %}
      {% else %}
       An anonymous person wrote:
      {% endif %}
        <div id="entry">
            <div id="entryTitleBox">
                <span id="voteBox">
                    <div id="upvoteButton"><a id="upvoteLink" {% if not loggedin %}href="/login"{% else %}href="/upvote?key={{ entry.entry.key }}"{%endif%}><img src="images/upvote.png" border="0" srcover="images/upvote-hover.png" /></a></div>
                    <div id="downvoteButton"><a id="downvoteLink" {% if not loggedin %}href="/login"{% else %}href="/downvote?key={{ entry.entry.key }}"{%endif%}><img src="images/downvote.png" border="0" srcover="images/downvote-hover.png" /></a></div>
                </span>
                <span id="entryTitle">{{ entry.entry.title }}</span>
            </div>
            <div id="entryContentBox">
                {%if entry.entry.content%}<div id="entryContent">{{ entry.entry.content }}</div>{%endif%}
                <div id="entryByline">
                    <div id="author">by <span>{{ entry.entry.author.nickname }}</span></div>
                    <div id="entryAgo">{{ entry.ago }} ago</div>
                    <div id="upvotes"><span>{{ entry.entry.upvotes }}</span> upvotes.</div>  
                </div>
            </div>
        </div>
    {% endfor %}
    <div id="postInputForm">
    <div id="formInputText">Post Content</div>
    <form action="/postEntry" method="post" id="postEntry">
      <div><span>Title</span><input type="text" {% if not loggedin %}DISABLED{% endif %} name="title" rows="3" cols="60"></input></div>
      <div><span>Body</span><textarea {% if not loggedin %}DISABLED{% endif %} name="content" rows="3" cols="60"></textarea></div>
      <div><input {% if not loggedin %}DISABLED{% endif %} type="submit" value="Post Entry"></div>
      <div><span>Category</span><select name="category">
        {% for category in categories %}
        {% endfor %}
        </select></div>
      <div><span>Tags</span><input type="text" {% if not loggedin %}DISABLED{% endif %} name="tags" rows="3" cols="60"></input></div>
    </form>
    </div>

  </body>
</html>
